//    Copyright (C) Kherty.  All rights reserved.
using System;
using System.Collections.Generic;
using System.Text;
using OpenLS.Core.Serialization;
using OpenLS.Vml.Serialization;

namespace OpenLS.Vml.Drawing
{
    class Skew: ShapeElement
    {
        private Ext? _ext;
        private string _id;
        private bool? _on;
        private string _offset;
        private string _origin;
        private string _matrix;

        internal override void ReadXmlCore(ReadContext context)
        {
            using (var c = context.Read(VmlConstants.WordNamespace + "skew"))
            {
                _ext = c.GetOptionalEnum<Ext>(VmlConstants.VmlNamespace + "ext");
                _id = c.GetOptionalString("id");
                _on = c.GetOptionalBoolean("on");
                _offset = c.GetOptionalString("offset");
                _origin = c.GetOptionalString("origin");
                _matrix = c.GetOptionalString("matrix");
            }
        }

        internal override void WriteXmlCore(WriteContext context)
        {
            using (var c = context.Write(VmlConstants.WordNamespace + "skew"))
            {
                c.SetOptionalEnum<Ext>(VmlConstants.VmlNamespace + "ext", _ext);
                c.SetOptionalString("id",_id );
                c.SetOptionalBoolean("on", _on);
                c.SetOptionalString("offset", _offset);
                c.SetOptionalString("origin", _origin);
                c.SetOptionalString("matrix", _matrix);
            }
        } 
    }
}
